const TOKEN_NAME = 'hm-news-token'

// 本地存储token值
export const setStorageToken = token => {
  localStorage.setItem(TOKEN_NAME, JSON.stringify(token))
}

// 清空本地的token值
export const removeStorageToken = token => {
  localStorage.removeItem(TOKEN_NAME)
}

// 获取本地存储的token值,如果没有获取空数组
export const getStorageToken = token => {
  return JSON.parse(localStorage.getItem(TOKEN_NAME)) || {}
}
